package com.edu.exam.enums.analysis;

/**
 * 数据质量枚举
 */
public enum DataQuality {
    EXCELLENT("EXCELLENT", "优秀"),
    GOOD("GOOD", "良好"),
    FAIR("FAIR", "一般"),
    POOR("POOR", "较差"),
    INSUFFICIENT("INSUFFICIENT", "不足");

    private final String code;
    private final String description;

    DataQuality(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static DataQuality fromCode(String code) {
        for (DataQuality quality : values()) {
            if (quality.getCode().equals(code)) {
                return quality;
            }
        }
        return POOR;
    }
}